/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.distribution.comment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.bean.model.Order;
import com.yami.shop.bean.model.OrderItem;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.distribution.comment.model.DistributionProd;
import com.yami.shop.distribution.comment.model.DistributionProdLog;
import com.yami.shop.distribution.comment.po.DistributionProdPO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DistributionProdMapper extends BaseMapper<DistributionProd> {

    IPage<DistributionProd> distributionProdsPage(Page page, @Param("distributionProd") DistributionProd distributionProd, @Param("prodName") String prodName, @Param("dbLang") Integer dbLang);

    IPage<DistributionProdPO> distributionProdPOPage(Page page, @Param("prodName") String prodName,
                                                     @Param("sort") Integer sort, @Param("orderBy") Integer orderBy, @Param("dbLang") Integer dbLang);

    DistributionProdPO getDistributionProdPOByProdId(@Param("prodId") Long prodId);

    int updateState(@Param("distributionProdId") Long distributionProdId, @Param("state") int state);

    IPage<DistributionProdLog> getDistributionProdLogPage(@Param("page") PageParam<DistributionProdLog> page, @Param("distributionProdLog") DistributionProdLog distributionProdLog, @Param("dblang") Integer dblang);

    List<DistributionProd> listByOrderItems(@Param("orderItems") List<OrderItem> orderItems);
}
